<html> 
<script type="text/javascript">
function validateForm()
{
var x=document.forms["register"]["password"].value;
var y=document.forms["register"]["pass1"].value;
if (x != y){
  document.getElementById('passerror').style.visibility='visible';
  return false;
  }else{
	  document.getElementById('passerror').style.visibility='hidden';
	  var t = document.forms["register"]["validate"].disabled=false;
	  return true;
	}
}
</script>
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    <title>Endurance racing - Register </title> 
    <link rel="stylesheet" type="text/css" href="/jQueryUI/css/custom-theme/jquery-ui-1.8.16.custom.css" />
    <script type="text/javascript" src="../jquery.js"></script>
    <script type="text/javascript" src="/jQueryUI/js/jquery-ui-1.8.16.custom.min.js"></script>
</head> 
<script>
$('input').button();
</script>
<body>

<div style="position:absolute;top:10px" id="reg-form">
	<div><h3>Create account</h3><hr></hr></div>
	<form action="register.php" method="post" name="register"">
			<div style="position:relative">Username:</div><input type="text" name="username" />*<hr></hr>
			<div style="position:relative">Password</div><input type="password" name="password" />*<hr></hr>
			<div style="position:relative">Confirm password</div><input type="password" name="pass1" onblur="return validateForm()"/>*<hr></hr>
			<div style="position:relative">Email</div><input type="text" name="email" />*<br></br>
			<div style="position:relative;float:right"><input type="submit" value="register" disabled="disabled" id="validate"/></div>
	</form>
</div>
<div style="visibility:hidden" id="passerror"><h3>Passwords don't match! Try again!</h3></div>
<?php 
include 'saveDB.php';
$uname = $_REQUEST['username'];
$pass = $_REQUEST['password'];
$pass1 = $_REQUEST['pass1'];
$email = $_REQUEST['email'];
if(($uname == '')||($pass == '')||($pass1 == '')||($email == '')){
	echo 'Please fill in all the requiered information. Requiered information is marked with an asterisk.';
}else{
	add_account($uname,$pass,$email);
}
?>
</body> 
</html> 